/**
 * Copyright (C) BFH www.bfh.ch 2011
 * Code written by: Patrick Dobler, Marc Folly
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ch.bfh.ti.kybernetik.engine.controller.roboter;

import java.util.List;

import ch.bfh.ti.kybernetik.engine.model.Motor;
import ch.bfh.ti.kybernetik.engine.model.Roboter;
import ch.bfh.ti.kybernetik.engine.model.RoboterMove;
import ch.bfh.ti.kybernetik.lego.ki.RoboterKI;

/**
 * The Controller Class for a {@link Roboter} Model. The Class takes care to
 * calculate the {@link RoboterMove} and connects a {@link Roboter} Model with
 * it's {@link RoboterKI} and it's {@link RoboterConstruction}F
 * 
 */
public interface RoboterController {

	/**
	 * Calculates the new {@link Roboter} position given by the left and right
	 * sensor intensity
	 * 
	 * @param leftSensorIntensity
	 * @param rightSensorIntensity
	 * @return {@link RoboterMove} instance having the information about the new
	 *         set {@link Roboter} position and direction
	 */
	abstract RoboterMove calculateNewRoboterPosition(double leftSensorIntensity, double rightSensorIntensity);

	/**
	 * Calculates a List of the given amount (count param) of
	 * {@link RoboterMove} that the current {@link Roboter} is about to perform
	 * with it's current state. Meaning without to change the {@link Roboter}'s
	 * state such as direction and {@link Motor} speed
	 * 
	 * @param count
	 * @return List of the next {@link RoboterMove} which the {@link Roboter} is
	 *         about to take by the currently set {@link Roboter} states
	 */
	public abstract List<RoboterMove> calculateNextEstimatedRoboterMoves(int count);

	/**
	 * 
	 * @return the {@link Roboter} Model that the {@link RoboterController}
	 *         controls
	 */
	public abstract Roboter getRoboter();

	/**
	 * 
	 * @return the {@link RoboterConstruction} that the
	 *         {@link RoboterController} controls
	 */
	public abstract RoboterConstruction getRoboterConstruction();

	/**
	 * Set the deltaT value which defines the cycle modification factor of the
	 * {@link RoboterMove}
	 * 
	 * @param deltaT
	 */
	public abstract void setDeltaT(double deltaT);

	/**
	 * Get the deltaT value which defines the cycle modification factor of the
	 * {@link RoboterMove}
	 */
	public abstract double getDeltaT();

	/**
	 * Returns a List of the last {@link RoboterMove} instances that the
	 * {@link RoboterController} performed <br/>
	 * <br/>
	 * <strong>Note:</strong> It's the implementation that decided whether that
	 * list can grow unlimited or is limited
	 * 
	 * @return List of the last {@link RoboterMove} instances
	 */
	public abstract List<RoboterMove> getRoboterMoveHistory();

	/**
	 * 
	 * @return the {@link RoboterKI} that the {@link RoboterController} holds
	 */
	public abstract RoboterKI getRoboterKI();

	/**
	 * Changes the current {@link RoboterKI}
	 * 
	 * @param roboterKI
	 *            the new {@link RoboterKI} to set
	 */
	public abstract void setRoboterKI(RoboterKI roboterKI);

}